package com.img.shop.service;

import com.img.shop.mapper.LoginMapper;
import com.img.shop.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;


@org.springframework.stereotype.Service
public class LoginServiceImpl implements LoginService{

    @Autowired
    LoginMapper loginMapper;

    public boolean login(User user) {
        User u = loginMapper.getUserByUsername(user.getUsername());
        if(u != null && u.getPassword().equals(user.getPassword())){
            return true;
        }
        return false;
    }
}